import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadPoolExecutor;

public class Demo2 {

    public static void main(String[] args) {

        ExecutorService executorService = Executors.newFixedThreadPool(4);
        for (int i = 0; i < 1000; i++) {
            int id = i;
            executorService.submit(() -> {

                System.out.println("hello " + id + ", " + Thread.currentThread().getName());
            });


        }
    }
}
